package Ex1;

/**
 * @author ZZQ
 * @PackageName: Ex1
 * @ClassName: Ex101
 * @Description:
 * @date 2021/1/18 16:33
 */
public class Ex101 {
    public static void main(String[] args) {
        System.out.println("前100项目和为" + sum(100));
    }
    public static int sum(int n){
        if (n == 1){
            return 1;
        }
        return n + sum( n - 1);
    }

}


